import java.util.Scanner;

public class Test1 {
    //查找整数中二进制中1的个数
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            int n = scanner.nextInt();
            int count = 0;
            while(n != 0){
                if((n&1) == 1){
                    count++;
                }
                n >>= 1;
            }
            System.out.println(count);
        }
    }
    //手套问题
    public static int func(int n, int[] left, int[] right){
        int sum = 0;
        int leftMin = Integer.MAX_VALUE;
        int rightMin = Integer.MAX_VALUE;
        int leftSum = 0;
        int rightSum = 0;
        for (int i = 0; i < n; i++) {
            if(left[i] * right[i] == 0){
                sum += left[i] + right[i];
            }else{
                    leftSum += left[i];
                    rightSum += right[i];
                    if(leftMin > left[i]){
                        leftMin = left[i];
                    }
                    if(rightMin > right[i]){
                        rightMin = right[i];
                    }
            }
        }
        return Math.min(leftSum-leftMin+1,rightSum-rightMin+1) + 1 + sum;
    }
    public static void main1(String[] args) {
        int n = 4;
        int[] array1 = {0,7,1,6};
        int[] array2 = {1,5,0,6};
        int m = func(n,array1,array2);
        System.out.println(m);
    }
}
